<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        window.onload = function () {
            var arr = [12,34,5,67,88,2,33];
            arr.sort(function (n1,n2) {//sort只认识字符串
                return n1-n2;
            });
             alert(arr);

        }
    </script>
</head>
<body>

</body>
</html>